package com.sdy.dataexchange.meta.mapper;

import com.sdy.dataexchange.meta.model.MetadataColumn;
import com.sdy.mvc.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Objects;

/**
 * @author: 王越洋
 * @version: v1.0
 * @description: com.sdy.dataexchange.meta.mapper
 * @date:2019/10/31
 */
@Repository
public interface MetadataColumnMapper extends BaseMapper<MetadataColumn> {
    Integer addOracleTabColumns(@Param("metadataColumns") List<MetadataColumn> metadataColumns);


    /**
     * 根据 字段ID 删除字段
     * @param colId
     * @return
     */
    Integer delByColIdColumn(@Param("colId") Integer colId);

    /**
     * 删除 mod 对应的 表字段
     *
     * @param modId
     * @return
     */
    Integer delAllTabColums(@Param("modId") Integer modId);

    List<MetadataColumn> queryByModId(@Param("modId") Integer modId);

    Integer delByIdTabColums(@Param("columnId") Integer columnId);

    Integer addOneTabColumns(@Param("metadataColumn") MetadataColumn metadataColumn ,@Param("modId")Integer modId);

    Integer updByIdTabColumns(@Param("columnId") Integer columnId, @Param("type")Integer type, @Param("column")MetadataColumn column);


}
